The measurement of samples by X-ray fluorescence (XRF) is a technique well known for industrial analysis. Individual spectral lines correspond to individual elements. A sample can be measured and the strength of the respective XRF spectral line gives a measure of the amount of the corresponding element.
In layered samples analysis can be difficult. This applies in particular in the case that only a limited amount of spectral lines are available for measurement. With layers of finite thickness, X-rays on one layer may pass through another layer and be partially absorbed.
For further details of the methods that can be used to calculate parameters of layered samples from XRF measurements see chapter 5.5 of the Handbook of Practical X-Ray Fluorescence Analysis XRF, by Peter Brouwer (ISBN 90-9016758-7).
In the case that an XRF line comes from an element in a single one of the layers it is possible to measure the intensity and calculate one variable, for example the concentration of the element in that layer or the thickness of the layer, or the thickness of the layer above the layer that contains that element. However, it is not in general possible to tell from which layer a measured signal is coming from in the case that the element may be present in more than one of the layers. Accordingly, in the case that intensity in a given spectral line could come from more than one layer it is not possible to carry out such analysis without more information which may not be available, especially in an industrial setting.